import request from '@/utils/request'

export const sendRoles = function(pages) {
  return request.get('/sys/role', { params: pages })
}
export const sendDelete = function(id) {
  return request.delete('/sys/role/' + id)
}
export const sendAddRole = function(roleForm) {
  return request.post('/sys/role', roleForm)
}
export const sendEditRole = function(data) {
  return request.put('/sys/role/' + data.id, data)
}
export const updateRole = function(id, roleIds) {
  return request.put('/sys/user/assignRoles', { id, roleIds })
}
export const getPermissionDetail = function(id) {
  return request.get('/sys/role/' + id)
}
export const savePermission = function({ id, permIds }) {
  return request.put('/sys/role/assignPrem', { id, permIds })
}

